//
//  goveServiceVC.m
//  HappyStore
//
//  Created by 陈锋 on 16/5/24.
//  Copyright © 2016年 LLJ. All rights reserved.
//

#import "goveServiceVC.h"
#import "goveServiceCell.h"

@interface goveServiceVC ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableview;

@end

@implementation goveServiceVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"服务机构";
    
    // 设置返回按钮
    UIBarButtonItem *leftItem = [UIBarButtonItem itemWithTarget:self action:@selector(leftBarButtonItemClick) image:@"Back" highImage:@"Back"];
    self.navigationItem.leftBarButtonItem = leftItem;
    
    self.tableview.delegate = self;
    self.tableview.dataSource = self;
    self.tableview.showsVerticalScrollIndicator = NO;
    self.tableview.showsHorizontalScrollIndicator = NO;
    
    [self sendRequest];
}

-(void)leftBarButtonItemClick{
    
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark - 请求数据
-(void)sendRequest{
    NSMutableDictionary * dic = [NSMutableDictionary  dictionary];
    dic[@"userId"] = self.userId;

    [LSHttpTool sendHttpData:@"goveServicejigou_app_myHome.im" params:dic success:^(id responseObject) {
        
        NSDictionary *dicInfo = [NSDictionary dictionaryWithDictionary:responseObject];
        NSDictionary *dataDic = [NSDictionary dictionary];
        dataDic = dicInfo[@"data"];

        
    } failure:^(NSError *error) {
        [SVProgressHUD showErrorWithStatus:@"网络连接错误"];
        [SVProgressHUD dismissafterDelay:kHideHudDelay];
        [self.tableview.mj_footer endRefreshing];
        [self.tableview.mj_header endRefreshing];
    }];
}
@end
